<template>
  <div>
    <!-- 首页头部 -->
    <!--  <div class="header">
      <ul>
        <li>
          <span>登录</span>
          <span>|</span>
          <span>注册</span>
        </li>
        <li>
          <a href="#">我的订单</a>
        </li>
        <li>
          <a href="#">我的收藏</a>
        </li>
        <li>
          <el-button>
            <i class="el-icon-shopping-cart-full"></i>
            购物车 (0)
          </el-button>
        </li>
      </ul>
    </div> -->
    <heads></heads>
    <!-- 导航栏 -->
    <div class="nav">
      <div class="ban">
        <img src="/imgs/logo.png" alt="" />

        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          router
        >
          <el-menu-item index="/main">首页</el-menu-item>
          <el-menu-item index="/allShop">全部商品</el-menu-item>
          <el-menu-item index="4">关于我们</el-menu-item>
        </el-menu>

        <el-input
          inline
          placeholder="请输入内容"
          v-model="search"
          class="input-with-select"
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            @click="searchClick"
          ></el-button>
        </el-input>
      </div>
    </div>
    <div class="">
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </div>
    <foote />
 <!-- 注册模态框 -->
    <!--  <el-dialog
        :visible.sync="dialogShow"
        width="300px"
       clearable
      >
      <h3>注册</h3>
        <el-input
    placeholder="请输入账号"
    prefix-icon="el-icon-user"
    v-model="userName">
  </el-input>
   <el-input
    placeholder="请输入密码"
    prefix-icon="el-icon-view"
    v-model="password">
  </el-input>
  <el-input
    placeholder="请再次输入密码"
    prefix-icon="el-icon-view"
    v-model="againPassword">
  </el-input>
        <span slot="footer" class="dialog-footer">
         <el-button type="primary" style="width:100%">注册</el-button>
        </span>
      </el-dialog>  -->
      <!-- 登录模态框 -->
      <!--   <el-dialog
        :visible.sync="loginShow"
        width="300px"
       clearable
      >
      <h3>登录</h3>
        <el-input
    placeholder="请输入账号"
    prefix-icon="el-icon-user"
    v-model="userName">
  </el-input>
   <el-input
    placeholder="请输入密码"
    prefix-icon="el-icon-view"
    v-model="password">
  </el-input>
        <span slot="footer" class="dialog-footer">
         <el-button type="primary" style="width:100%">登录</el-button>
        </span>
      </el-dialog>  -->
     <!--  <dialog></dialog> -->
  </div>
</template>
<script>
import heads from "../components/head";
import foote from "../components/footer";
export default {
  name: "",
  components: { heads, foote },
  data() {
    return {
      search: "",
      activeIndex: "",
   /*    dialogShow: false, //控制注册模态框的显示隐藏
      loginShow:false,//控制登录模态框的显示隐藏 */
    
    };
  },

  props: [], //接收父组件传过来的值

  mounted() {},
  methods: {
    searchClick() {
      //                this.search 当前搜索的内容
      this.$router.push({ path: "/allShop", query: { search: this.search } });
      this.search = "";
    },
    signUp() {
      /* 用户密码账号 */
      /* /users/findUserName */
      this.dialogShow = true;
    },
    doLogin(){
        this.loginShow = true;
    }
  },
  computed: {},

  watch: {},
};
</script>

<style lang='scss' scoped>
.header {
  /*   width: 100%; */
  height: 40px;
  background-color: #3d3d3d;
  margin-bottom: 20px;

  ul {
    display: flex;
    justify-content: flex-end;
    margin-right: 70px;
    li {
      list-style: none;
      line-height: 40px;
      border-radius: 0%;
      padding: 0%;
      cursor: pointer;
      span {
        margin-right: 10px;
        color: #b0b0b0;
      }
      span:hover {
        color: white;
      }
      a {
        color: #b0b0b0;
        margin-right: 20px;
        margin-left: 10px;
        text-decoration: none;
      }
      a:hover {
        color: white;
      }
      .el-button {
        width: 100%;
        border-radius: 0%;
        margin-right: 40px;
        /*  padding-right: 30px;
           padding-left: 30px; */
        background: #424242;
        color: #b0b0b0;
        border: none;
      }
      .el-button:hover {
        background: white;
        color: orangered;
      }
    }
    li:nth-child(4) {
      width: 120px;
      /* margin-top: -0px; */
      padding-top: 0;
      text-align: center;
    }
  }
}
.nav {
  width: 1225px;
  border-bottom: 1px solid #ddd;
  margin: 0 auto;
  .ban{
    width: 100%;
    height: 60px;
    line-height: 60px;
    display: flex;
    align-items: center;
    /* justify-content: space-evenly; */
    img {
      margin-right: 72.5px;    
    }
    .el-menu-item {
      margin-right: 20px;
    }
    .el-input {
      width: 350px;
      margin-left: 290px;
    }
  }
}
/*  .el-dialog{
  margin: 0 auto;
  
  .el-input{
   margin-top: 20px;
  }
 h3{
   font-size: 20px;
   text-align: center;
   font-weight: 400;
 }
}  */
</style>